/*
 * Copyright (C) 拾光分享网 
 * All rights reserved, Designed By www.hiai.top.
 * Email：goodsking@163.com.
 * Version：V1.0.2(20230701).
 */
package top.hiai._admin.index;

import com.jfinal.kit.Ret;
import com.jfinal.plugin.activerecord.Db;

/**
* @Author www.hiai.top
* @Email  goodsking@163.com
* @Message 更多资源尽在www.hiai.top
* @Introduction 类的介绍
*/

public class IndexAdminService {
	
	public static final IndexAdminService me = new IndexAdminService();

	/**
	 * 用户总数
	 * @return
	 */
	public Ret getAccountProfile() {
		Ret ret = Ret.by("title", "用户总数");
		Integer total = Db.queryInt("select count(*) from bbs_user");
		ret.set("total", total);
		return ret;
	}
	
	/**
	 * 文章总数
	 * @return
	 */
	public Ret getAricletProfile() {
		Ret ret = Ret.by("title", "文章总数");
		Integer total = Db.queryInt("select count(*) from bbs_article");
		ret.set("total", total);
		return ret;
	}
	
	/**
	 * 评论总数
	 * @return
	 */
	public Ret getReplyProfile() {
		Ret ret = Ret.by("title", "评论总数");
		Integer total = Db.queryInt("select count(*) from bbs_reply");
		ret.set("total", total);
		return ret;
	}
	
	/**
	 * 分类总数
	 * @return
	 */
	public Ret getCommentsProfile() {
		Ret ret = Ret.by("title", "分类总数");
		Integer total = Db.queryInt("select count(*) from bbs_comments");
		ret.set("total", total);
		return ret;
	}

}